System and Method for Caching Time Series Data

ABSTRACT

The present invention provides a method and system for caching time series data. A computer system for caching time series data is disclosed. The computer system comprises one or more processors, at least one cache, and a computer readable storage medium. The computer readable storage medium contains instructions that, when executed by the one or more processors, causes the one or more processors to perform a set of steps comprising fetching the time series data from a time series data source, calculating one or more expiry timestamps, grouping the plurality of time series datum in to one or more time data chunks based on the one or more expiry timestamps, and storing a copy of the time series data and the one or more expiry timestamps in the at least one cache.

FIELD OF INVENTION

The present invention relates to time series data, and in particular, itrelates to caching of time series data.

BACKGROUND

Time series data refers to sequences of data points measured over a.span of tune, often spaced at uniform time intervals. Time series datais often stored on a remote server known as historian. The historian isresponsible for collecting raw time series data and cleaning raw timeseries data. For analysis and query purposes, time series data isfetched from the historian. However, due to the ever increasing size oftune series data, retrieval of time series data is an expensiveoperation in terms of network resources.

There have been several approaches to optimize the retrieval of timeseries data. One such approach (US 20110153603, Adiba et al.; US20110167486, Ayloo et al.) suggests the usage of a cache memory forholding recent time series data. However, this approach is ofteninefficient as the cached time series data is not reflective of theactual time series data. Time series data is mutable since correctionsare often made to the time series data at a later point of time. When acorrection is made to the actual time series data, the cached data is nolonger valid. Since the current approach does not take into account themutable nature of time series data, the current approach is inefficient.

Therefore, in light of the above discussion, there is a need for amethod and system which overcomes all the above stated problems.

BRIEF DESCRIPTION OF THE INVENTION

The above-mentioned shortcomings, disadvantages and problems areaddressed herein which will be understood by reading and understandingthe following specification.

In embodiments, the present invention provides a computer system forcaching time series data. The computer system includes one or moreprocessors, at least one cache, and a computer readable storage medium.The computer readable storage medium contains instructions that, whenexecuted by the one or more processors, causes the one or moreprocessors to perform a set of steps comprising: fetching the timeseries data from a time series data source, calculating one or moreexpiry timestamps, grouping the plurality of time series datum in to oneor more time data chunks based on the one or more expiry timestamps andstoring a copy of the time series data and the one or more expirytimestamps in the at least one cache

The time series data includes a plurality of time series datum and afetch timestamp. Each expiry timestamp from the one or more expirytimestamps is calculated using a composite function of the fetchtimestamp of the time series data and a recording time associated with atime series datum, such that the expiry timestamp is inverselyproportional to the recording time associated with the time series datumand directly proportional to the fetch timestamp of the time seriesdata. Each time data chunk from the one or more time data chunksincludes a distinct set of time series datum from the time series data.

In an embodiment, the one or more processors are configured to receive arequest for the time series data, decompose the request into one or moresub requests based on the one or more time data chunks of the timeseries data, determine the validity of the one or more time data chunksof the time series data based on the one or more expiry timestamps; andserve the one or more sub requests from one of a group consisting of thetime series data source and the at least one cache, based on thevalidity of the one or more time data chunks of the time series data.

In an embodiment, the one or more processors are configured to determinethe validity of the one or more time data chunks by comparing anassociated expiry timestamp with a request timestamp associated with therequest. In an embodiment, the composite function is monotonicallynon-increasing function with a predetermined upper limit. In anembodiment, the at least one cache is a browser cache.

In another aspect, the present invention provides a computer implementedmethod for caching time series data. The computer implemented methodcomprises fetching, by one or more processors, the time series data froma time series data source, calculating, by one or more processors, oneor more expiry timestamps, grouping, by one or more processors, theplurality of time series datum in to one or more time data chunks basedon the one or more expiry timestamps, and storing, by one or moreprocessors, a copy of the time series data and the one or more expirytimestamps in at least one cache.

Systems and methods of varying scope are described herein. In additionto the aspects and advantages described in this summary, further aspectsand advantages will become apparent by reference to the drawings andwith reference to the detailed description that follows.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a system for caching time series data, in accordancewith various embodiments of the present invention;

FIG. 2 illustrates a flowchart for serving time series data, inaccordance with various embodiments of the present invention;

FIG. 3 illustrates a flowchart for caching time series data, accordancewith various embodiments of the present invention;

FIG. 4 illustrates a flowchart for caching time series data and servinga request for time series data, in accordance with various embodimentsof the present invention; and

FIG. 5 illustrates a computer node for caching tune series data, inaccordance with various embodiments of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In the following detailed description, reference is made to theaccompanying drawings that form a part hereof and in which is shown byway of illustration specific embodiments, which may be practiced. Theseembodiments are described in sufficient detail to enable those skilledin the art to practice the embodiments, and it is to be understood thatother embodiments may be utilized and that logical, mechanical,electrical and other changes may be made without departing from thescope of the embodiments. The following detailed description is,therefore, not to be taken in a limiting sense.

FIG. 1 illustrates a system 100 for caching time series data, inaccordance with various embodiments of the present invention.

The computing system 100 includes a user terminal 110. In context of thepresent invention, the user terminal 110 refers to a workstation or aterminal used by a user 120. The user terminal 110 includes one or moreprocessors, a computer readable storage medium and at least one cache.The user terminal 110 allows the user 120 to retrieve the time seriesdata from a historian server 130, which is a time series data source. Inan embodiment, the user terminal 110 includes a browser with a browsercache. The user 120 uses the browser to view the time series data. Thebrowser stores the time series data in the browser cache for fasteraccess. In another embodiment, the user terminal 110 stores time seriesin the at least one cache for faster access. In an embodiment, the userterminal 110 allows the user 120 to execute queries on the time seriesdata present on the historian server 130.

The historian server 130 stores the time series data. The historianserver 130 includes one or more processors, a computer readable storagemedium and at least one server side cache. In an embodiment, thehistorian server 130 receives the time series data from a cluster ofapplication servers 140, which includes a plurality of time series datasources. In an example as shown in FIG. 1, the cluster of applicationservers 140 includes application server 142, application server 144, andapplication server 146. Each application server from the cluster ofapplication servers 140 generates a log file which contains the timeseries data. The log files are sent to the historian server 130 by thecluster of application servers 140. In an embodiment, the cluster ofapplication servers 140 are advertisements tracking servers thatmaintain logs about countable metrics, such as clicks & impressions,etc. In an embodiment, the historian server 130 assimilates the logfiles, cleans the data in the log files by removing inconsistent andincomplete records and stores resultant time series data. In anembodiment, the historian server 130 stores recently accessed timeseries data in the least one server side cache for faster service.

It will be appreciated by the person skilled in the art, that while FIG.1, shows the historian server 130 as a single computing device, thehistorian server 130 can include multiple computing devices connectedtogether. Similarly, it will be appreciated by the person skilled in theart, that While FIG. 1 shows a single user terminal 110, there can aplurality of computing devices connected to the historian 130. Theplurality of computing devices includes a chain of computing devicesconnected sequentially. The present invention is compatible with thechain of computing devices.

Moreover, it will be appreciated by the persons skilled in the art thatwhile FIG. 1 shows four application servers 142, 144 and 146, there canbe one or more application servers in the cluster of application servers140. Further, the application servers can be used for a plurality ofpurposes such as factory metrics recording, product quality control andautomation, weather monitoring, etc.

FIG. 2 illustrates a flowchart 200 for serving a request for time seriesdata, in accordance with various embodiments of the present invention.The flowchart 200 is implemented using the user terminal 110. At step205, the flowchart 200 initiates. At step 210, the user terminal 110receives a request for time series data. In an example, at 7 pm the user120 requests for time series data between 2 pm and 6 pm. The requestedtime series data has 6 time series datum, since the granularity ofsampling is 1 hour in the current example

At step 215, the user terminal 110 calculates one or more expirytimestamps. Continuing the above mentioned example, the user terminal110 calculates each expiry timestamp from the one or more expirytimestamps using a composite function of a recording time of a timeseries datum and the current time 7 pm. Each expiry timestamp calculatedusing the composite function is inversely proportional to the recordingtime associated with the time series datum (indicated using the notationT_(record)) and directly proportional to the current time (indicatedusing the notation T_(current)). A mathematical representation of theabove statement is given below:

if T _(current) >T _(current+X), then T _(expiry N) >T _(expiry N+X)  1)

if T _(record N) <T _(record N+Y), then T _(expiry N) >=T_(expiry N+Y)  2)

In an embodiment, the composite function is a monotonically nonincreasing function between recording timestamp and expiry timestamp,i.e., as the recording time increases the value of the expiry timestampdecreases.

Continuing the example mentioned above, initially 6 expiry timestampsare calculated using the composite function; each expiry timestamp foreach time series datum present in the tune series data. An illustrationof a possible composite function with an upper limit of 24 hour isdefined below:

expiry timestamp T_(expiry)= F_(composite)(T_(record), T_(current))F_(composite) (T_(record), T_(current))= { if (T_(current) -T_(record))< 30 minutes, then T_(expiry) should be T_(current) + 2minutes; else if 30 minutes <=(T_(current) - T_(record))< 5 hours, thenT_(expiry) should be T_(current) + 15 minutes; else if 5 hours <=(T_(current) - T_(record)) < 24 hours, then T_(expiry) should beT_(current) + 1 hour; else, T_(expiry) should be T_(current) + 24 hours;}

Using the abovementioned composite function, the following expirytimestamps are calculated:

Time series datum 1 8 pm

Time series datum 2 7:15 pm

Time series datum 3 7:15 pm

Time series datum 4 7:15 pm

Time series datum 5 7:15 pm

Time series datum 6 7:15 pm

While the expiry timestamp is calculated for each time series datum inthe time series data, there are only two distinct expiry timestamps: 8pm and 7:15 pm. These two timestamps are final result of step 215.

At step 220, the user terminal 110 decomposes the request into one ormore sub requests based on the one or more expiry timestamps. Continuingthe abovementioned example, the request is broken in two sub requests,the first sub request for the time series datum having expiry timestamp8:00 pm and the second sub request for the time series data havingexpiry timestamp 7:15 pm.

At step 225, the user terminal serves the one or more sub request fromat least one of the historian 130 and a cache memory. The user terminal110 will query the cache memory to determine if a copy of time seriesdata exists in the cache, if the copy of time series data exists in thecache the user terminal 110 serves a sub-request from the cache. If thecache does not contain the copy of the time series data, the userterminal 110 retrieves the time series data from the historian server130. At step 230, the flowchart 200 terminates.

FIG. 3 illustrates a flowchart 300 for caching the time series data, inaccordance with various embodiments of the present invention. Theflowchart 300 is implemented using the historian server 130.

At step 310, the flowchart 300 initiates. At step 320, the historianserver 130 fetches the time series data from the application servers140. In an embodiment, the historian server 130 fetches the time seriesdata in response to a determination that a valid copy of the time seriesdata does not exist locally. In an embodiment, the historian server 130fetches the time series data in response to a user query. In anotherembodiment, the historian server 130 automatically fetches the timeseries data in response to a pre-fetching policy. The time series dataincludes a plurality of time series datum and a fetch timestamp. Thefetch timestamp indicates the time at which the time series data wasfetched by the historian server 130. In an embodiment, the historianserver 130 records the fetch timestamp on receiving a request.

For example, the time series data includes ten time series datum: {45,65, 78, 90, 112, 120, 123, 145, 170, 210} and a fetch timestamp: 9 pm.The time series data has a sampling period of half an hour. The firsttime series datum 45 is recorded at 2 pm, the second time series datum65 is recorded at 2:30 pm, and the rest of the time series datasimilarly recorded with a periodic interval of half an hour. The fetchtimestamp 9 pin indicates that the time series data was fetched at 9 pm.

At step 330, the historian server 130 calculates one or more expirytimestamps. Each expiry timestamp from the one or more expiry timestampsis calculated using a composite function of a recording time of a timeseries datum and the fetch timestamp. Each expiry timestamp calculatedusing the composite function is inversely proportional to the recordingtime associated with the time series datum and directly proportional tothe fetch timestamp of the time series data. A mathematicalrepresentation of the above statement is given below:

if T _(fetch N) >T _(fetch N+X), then T _(expiry N) >T _(expiry N+X)  1)

if T _(record N) <T _(record N+Y), then T _(expiry N) >=T_(expiry N+Y)  2)

In an embodiment, the composite function is a monotonically nonincreasing function between recording timestamp and expiry timestamp,i.e., as the recording tune increases the value of the expiry timestampdecreases.

Continuing the example mentioned above, initially 10 expiry timestampsare calculated using the composite function; each expiry timestamp foreach time series datum present in the time series data. An illustrationof a possible composite function with an upper limit of 24 hour isdefined below:

expiry timeStamp T_(expiry)= F_(composite)(T_(record), T_(fetch))F_(composite) (T_(record), T_(fetch))= {  if (T_(fetch) - T_(record))<30 minutes, then T_(expiry) should be T_(fetch) + 2 minutes;  else if 30minutes <=(T_(fetch) - T_(record))< 5 hours,  then T_(expiry) should beT_(fetch) + 15 minutes;  else if 5 hours <= (T_(fetch) - T_(record)) <24 hours,  then T_(expiry) should be T_(fetch) + 1 hour;  else,T_(expiry) should be T_(fetch) + 24 hours;  }

Using the abovementioned composite function, the following expirytimestamps are calculated:

Time series datum 1 10 pm

Time series datum 2 10 pm

Time series datum 3 10 pm

Time series datum 4 10 pm

Time series datum 5 10 pm

Time series datum 6 9:15 pm

Time series datum 7 9:15 pm

Time series datum 8 9:15 pm

Time series datum 9 9:15 pm

Time series datum 10 9:15 pm

While the expiry timestamp is calculated for each tune series datum inthe tune series data, there are only two distinct expiry timestamps: 10pm and 9:15 pm. These two timestamps are final result of step 330.

At step 340, the historian server 130 groups the plurality of timeseries datum into one or more time data chunks based on the one or moreexpiry timestamps. In an embodiment, all the time series datum whichhave the same expiry timestamp value are grouped together to form onetime data chunk. Each time data chunk from the one or more time datachunks comprises a distinct set of time series datum from the timeseries data, i.e. no two time data chunks can have a common time seriesdatum.

Continuing the abovementioned example, the user terminal groups the tentime series datum into two time data chunks. The first time data chunkincludes the tune series datum that have the expiry timestamp 10 pm(Time data chunk 1={45, 65, 78, 90, 112}). The second time data chunkincludes the time series datum that have the expiry timestamp 9:15 pm(Time data chunk 2={120, 123, 145, 170, 210}).

At step 350, the historian server 130 stores a copy of the time seriesdata and the one or more expiry timestamps in the at least one cache.Expiry timestamps serve as indicators about the validity of the timeseries data stored in the at least one cache. Any request for the timeseries data will check the expiry timestamps to verify if the timeseries data stored in the at least one cache is valid or not. At step360, the flowchart 300 terminates.

FIG. 4 illustrates a flowchart 400 for caching time series data andserving a request for time series data, in accordance with variousembodiments of the present invention. The flowchart. 400 is beimplemented the historian server 130.

At step 405, the flowchart 400 initiates. Steps 410-425 of the flowchart300 are similar to the steps 310-350 of the flowchart 300. At step 410,as explained above, the historian server 130 fetches the time seriesdata from the historian server 130.

At step 415, as explained above, the historian server 130 calculates oneor more expiry timestamps. Each expiry timestamp from the one or moreexpiry timestamps is calculated using a composite function of arecording time of a time series datum and the fetch timestamp. Eachexpiry timestamp calculated using the composite function is inverselyproportional to the recording time associated with the time series datumand directly proportional to the fetch timestamp of the time seriesdata. In an embodiment, the composite function is a monotonically nonincreasing function between recording timestamp and expiry timestamp,i.e., as the value of recording time increases the value of the expirytimestamp decreases.

At step 420, the historian server 130 groups the plurality of timeseries datum into one or more time data chunks based on the one or moreexpiry timestamps. In an embodiment, all the time series datum whichhave the same expiry timestamp value are grouped together to form onetime data chunk. Each time data chunk from the one or more time datachunks comprises a distinct set of time series datum from the timeseries data, i.e. no two time data chunks can have a common time seriesdatum.

At step 425, the historian server 130 stores a copy of the time seriesdata and the one or more expiry timestamps in the at least one cache. Atstep 430, the historian server 130 receives a request for the timeseries data. In an embodiment, the user 120 makes the request using thebrowser on the user terminal 110. Continuing the abovementioned example,the user terminal receives a request for the time series data recordedbetween 2 pm and 6:30 pm at 9:45 pm.

At step 435, the historian server 130 decomposes the request into one ormore sub requests based on the one or more time data chunks of the timeseries data. Continuing the abovementioned example, the request isbroken in two sub requests, the first sub request for the first timedata chunk and the second sub request for the second time data chunk.

At step 440, the historian server 130 determines the validity of the oneor more time data chunks of the time series data based on the one ormore expiry timestamps. Continuing the abovementioned example, thehistorian server 130 determines the validity of the first time datachunk and the second time data chunk. The first time data chunk has theexpiry timestamp 10 pm, and therefore is valid at 9:45 pm. The secondtime data chunk has the expiry timestamp 9:15 pm, and therefore isinvalid at 9:45 pm.

At step 445, the historian server 130 serves the one or more subrequests from one of a group consisting of the time series data sourceand the at least one cache, based on the validity of the one or moretime data chunks of the time series data. Continuing the abovementionedexample, the historian server 130 serves the first sub request byretrieving the first time data chunk from the at least one cache as thefirst time data chunk is still valid. Since the second time data chunkis invalid, the historian server 130 serves the second sub request byfetching the second time data chunk from the application servers 140. Atstep 350, the flowchart 300 terminates.

By decomposing the request into sub request and chunking the time seriesdata into time data chunks, the present invention is able to create anoptimal caching policy for the time series data. Since older time seriesdata values are less likely to change, the composite function is able tocalculate expiry timestamps which are reflective of this property.Moreover, by dividing the request in sub requests, the present inventionis able to ensure that only the time data chunks which are invalid areserved from the time series sources and not the entire time series data.By doing so, the present invention is able to reduce network load andimprove speed of access.

FIG. 5 illustrates a computer node 500 for caching tune series data, inaccordance with various embodiments of the present invention. Thecomponents of the computer node 500 include, but are not limited to, oneor more processors 530, a memory module 555, a network adapter 520, aninput-output (I/O) interface 540 and one or more buses that couplesvarious system components to one or more processors 530.

The one or more buses represents one or more of any of several types ofbus structures, including a memory bus or memory controller, aperipheral bus, an accelerated graphics port, and a processor or localbus using any of a variety of bus architectures. By way of example, andnot limitation, such architectures include Industry StandardArchitecture (ISA) bus, Micro Channel Architecture (MCA) bus, EnhancedISA (EISA) bus, Video Electronics Standards Association (VESA) localbus, and Peripheral Component Interconnects (PCI) bus.

The computer node 500 typically includes a variety of computer systemreadable media. Such media may be any available media that is accessibleby the computer node 500, and includes both volatile and non-volatilemedia, removable and non-removable media. In an embodiment, the memorymodule 555 includes computer system readable media in the form ofvolatile memory, such as random access memory (RAM) 560 and at least onecache 570. The computer node 500 may further include otherremovable/non-removable, non-volatile computer system storage media. Inan embodiment, the memory module 555 includes a storage system 580.

The computer node 500 communicates with one or more external devices 550and a display 510, via input-output (I/O) interfaces 540. In addition,the computer node 500 can communicate with one or more networks such asa local area network (LAN), a general wide area network (WAN), and/or apublic network (for example, the Internet) via the network adapter 520.

It can be understood by one skilled in the art that although not shown,other hardware and/or software components can be used in conjunctionwith the computer node 500. Examples, include, but are not limited to:microcode, device drivers, redundant processing units, external diskdrive arrays. RAID systems, tape drives, and data archival storagesystems, etc. In an embodiment, the configuration and capabilities ofthe historian 130 and the user terminal 110 is same as configuration andcapabilities of the computer node 500.

As will be appreciated by one skilled in the art, aspects can beembodied as a system, method or computer program product. Accordingly,aspects of the present invention can take the form of an entirelyhardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit,” “module” or “system” Furthermore,aspects of the present invention can take the form of a computer programproduct embodied in one or more computer readable medium(s) havingcomputer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) can beutilized. The computer readable medium can be a computer readablestorage medium. A computer readable storage medium can be, for example,but not limited to, an electronic, magnetic, optical, electromagnetic,infrared, or semiconductor system, apparatus, or device, or any suitablecombination of the foregoing. More specific examples (a non-exhaustivelist) of the computer readable storage medium would include thefollowing: an electrical connection having one or more wires, a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), an optical fiber, a portable compact disc read-onlymemory (CD-ROM), an optical storage device, a magnetic storage device,or any suitable combination of the foregoing. In the context of thepresent invention, a computer readable storage medium can be anytangible medium that can contain, or store a program for use by or inconnection with an instruction execution system, apparatus, or device.

Computer program code for carrying out operations for aspects of thepresent invention can be written in any combination of one or moreprogramming languages, including an object oriented programming languageand conventional procedural programming languages.

This written description uses examples to describe the subject matterherein, including the best mode, and also to enable any person skilledin the art to make and use the subject matter. The patentable scope ofthe subject matter is defined by the claims, and may include otherexamples that occur to those skilled in the art. Such other examples areintended to be within the scope of the claims if they have structuralelements that do not differ from the literal language of the claims, orif they include equivalent structural elements with insubstantialdifferences from the literal language of the claims.

What is claimed is:
 1. A computer system for caching time series data,the computer system comprising: one or more processors; at least onecache; and a computer readable storage medium, wherein the computerreadable storage medium contains instructions that, when executed by theone or more processors, causes the one or more processors to perform aset of steps comprising: i. fetching the time series data from a timeseries data source, wherein the time series data comprises a pluralityof time series datum and a fetch timestamp; ii. calculating one or moreexpiry timestamps, wherein each expiry timestamp from the one or moreexpiry timestamps is calculated using a composite function of the fetchtimestamp of the time series data and a recording time associated with atime series datum, such that the expiry timestamp is inverselyproportional to the recording time associated with the time series datumand directly proportional to the fetch timestamp of the time seriesdata; iii. grouping the plurality of time series datum in to one or moretime data chunks based on the one or more expiry timestamps, whereineach time data chunk from the one or more time data chunks comprises adistinct set of time series datum from the time series data; and iv.storing a copy of the time series data and the one or more expirytimestamps in the at least one cache.
 2. The computer system as claimedin claim 1, wherein the one or more processors are configured to i.receive a request for the time series data; ii. decompose the requestinto one or more sub requests based on the one or more time data chunksof the time series data; iii. determine the validity of the one or moretime data chunks of the time series data based on the one or more expirytimestamps; and iv. serve the one or more sub requests from one of agroup consisting of the time series data source and the at least onecache, based on the validity of the one or more time data chunks of thetime series data.
 3. The computer system as claimed in claim 1, whereinthe one or more processors are configured to determine the validity ofthe one or more time data chunks by comparing an associated expirytimestamp with a request timestamp associated with the request.
 4. Thecomputer system as claimed in claim 1, wherein the composite function ismonotonically non-increasing function with a predetermined upper limit.5. The computer system as claimed in claim 1, wherein the at least onecache is a browser cache.
 6. A computer implemented method for cachingtime series data, the computer implemented method comprising: i.fetching, by one or more processors, the time series data from a timeseries data source, wherein the time series data comprises a pluralityof time series datum and a fetch timestamp; ii. calculating, by the oneor more processors, one or more expiry timestamps, wherein each expirytimestamp from the one or more expiry timestamps is calculated using acomposite function of the fetch timestamp of the time series data and arecording time associated with a time series datum, such that the expirytimestamp is inversely proportional to the recording time associatedwith the time series datum and directly proportional to the fetchtimestamp of the time series data; iii. grouping, by the one or moreprocessors, the plurality of time series datum in to one or more timedata chunks based on the one or more expiry timestamps, wherein eachtime data chunk from the one or more time data chunks comprises adistinct set of time series datum from the time series data; and iv.storing, by the one or more processors, a copy of the time series dataand the one or more expiry timestamps in at least one cache.
 7. Thecomputer implemented method as claimed in claim 6, further comprising:i. receiving, by the one or more processors, a request for the timeseries data; ii. decomposing, by the one or more processors, the requestinto one or more sub requests based on the one or more time data chunksof the time series data; iii. determining, by the one or moreprocessors, the validity of the one or more time data chunks of the timeseries data based on the one or more expiry timestamps; and iv. serving,by the one or more processors, the one or more sub requests from one ofa group consisting of the time series data source and the at least onecache, based on the validity of the one or more time data chunks of thetune series data.
 8. The computer implemented method as claimed in claim6, wherein determining the validity of the one or more time data chunkscomprises comparing an associated expiry timestamp with a requesttimestamp associated with the request.
 9. The computer implementedmethod as claimed in claim 6, wherein the composite function ismonotonically non-increasing function with a predetermined upper limit.10. A computer implemented method for serving time series data, thecomputer implemented method comprising: i. receiving, by one or moreprocessors, a request for the time series data; ii. calculating, by theone or more processors, one or more expiry timestamps, wherein eachexpiry timestamp from the one or more expiry timestamps is calculatedusing a composite function of current time and a recording timeassociated with a time series datum, such that the expiry timestamp isinversely proportional to the recording time associated with the timeseries datum and directly proportional to the current time iii.decomposing, by the one or more processors, the request into one or moresub requests based on the one or more expiry timestamps; and iv.serving, by the one or more processors, the one or more sub requestsfrom one of a group consisting of the time series data source and the atleast one cache, based on the one or more expiry timestamps.